updateStatusText(5, "This installer is not designed for a non-windows platform. Please locate the correct installer. Exiting.", 7, true, errorGraphic) ;
abortMe() ;
}
To figure out communicator version look here:
var Comm_vi = netscape.softupdate.Trigger.GetVersionInfo("Program/netscape.exe") ;
*/
function checkJava()
{
javaOn = navigator.javaEnabled() ; //check to see if java is enabled - nothing here works without it.
if (javaOn == false)
{
alert("You do not have java turned on, please enable Java, restart, and try again") ;
return false ;
}
return true ;
}
function checkASD()
{
SUEnabled = netscape.softupdate.Trigger.UpdateEnabled() ; // SmartUpdate won't work without it being on.
if (SUEnabled == false)
{
alert("AutoInstall is not turned on in Advanced Preferences, please enable it, restart, and try again") ;
return false ;
}
return true ;
}
function verifyOS(val) // val should be a digit either 16 or 32, passed as a string.
{
OS = navigator.platform ;
i = OS.substring(5,3) ;
if ( i != val)
{
alert("Sorry, the install you are downloading doesn't support your operating system. Install will not continue") ;
return false ;
}
return true ;
}
function checkNav()
{
navVer = navigator.appVersion ;
if (navVer.substring(0,4) == "4.01")
{
alert("You have already upgraded your Communicator to 4.01. Install is not necessary.") ;
return false ;
}
if (navVer.substring(0,4) != "4.0 ")
{
alert("Sorry, you must have Communicator 4.0 (not beta) in order to upgrade. Install will not continue") ;
return false ;
}
return true ;
}
function checkLang()
{
if (navigator.language != "en")
{
alert("Sorry, you must have Communicator 4.0 in English in order to upgrade. Install will not continue") ;
return false ;
}
return true ;
}
function fileInfoObject(fileName, fileDestFolder, fileSourcePath, fileVersion, fileLocalPath ) {
function checkSystemEnvironment() // OS check, memcheck, etc go here.
{
vi = new netscape.softupdate.VersionInfo(versionMaj, versionMin, versionRel, versionBld) ;
if (vi == null ) java.lang.System.out.println("new vi RETURNED NULL!") ;
return err ;
}
function setupFiles(su){
var errFlag = false ; // to catch errors inside the addsubcomponent loops.
updateStatusText(5, "Checking install privileges. Click 'grant' if you are asked to approve the installation in the Java Security dialog.", 1, false, normalGraphic) ;
// clean up window from redraw problem
wndw.frames[0].document.close() ; //clean the window first.
wndw.frames[1].document.close() ; //clean the window first.
err = su.StartInstall(nsRegName, // Package name for registry
vi,
1); //new api 1= full install
if (err !=0){
updateStatusText(hSize,"ERROR at StartInstall...", 4, true, errorGraphic) ;
function body() { //this section works in clumps - each clump gets an error check after it's called.
// the errorFlag is there to make sure I only call abortMe once.
if ( (su != null) )
{
updateStatusText(5,"You have started a process to upgrade Netscape Communicator from 4.0 to 4.01.", 8, false, "") ;
updateStatusText(5,"This new <I>SmartUpdate</I> technology will automatically launch another installer which will complete this process.", 8, false, "") ;
updateStatusText(5,"It is recommended that you not interrupt the install process until it is completed.",8, false, "") ;
err = checkSystemEnvironment() ; //checksystemenvironments, if it returns error, abort
if (( err != 0 ) && (errorFlag == false))
abortMe() ;
if (err == 0) {
updateStatusText(hSize,"Setting up external installer...", 1, false, "") ;
err = setupFiles(su) ; // and abort.
if (( err != 0 ) && (errorFlag ==false)) {
errorParse(err) ;
abortMe() ;
}
}
if (err == 0) // if we get to here, everythings cool and we can finalize install.
{
updateStatusText(5,"Please click 'Install' to launch external installer, or 'Cancel' to abort in the SmartUpdate window...", 0, false, "") ;
err = su.FinalizeInstall(); // This actually copies all the files to their right place
if ((err == 999) || (err == 6)) err = 0 ; // Reboot is required, & parameter error- don't report as an error.
if (( err != 0 ) && (errorFlag ==false)) {
errorParse(err) ;
abortMe() ;
}
}
if (( err != 0 ) && (errorFlag ==false)) // If we have an error, write it to the console